# Copyright 2016 The Slam Authors


#  Usage from an external project:
#    In your CMakeLists.txt, add these lines:
#
#    find_package(slam REQUIRED)
#    target_link_libraries(MY_TARGET_NAME PUBLIC slam)

@PACKAGE_INIT@

set_and_check(SLAM_CMAKE_DIR "@PACKAGE_SLAM_CMAKE_DIR@")

set(CERES_DIR_HINTS @Ceres_DIR@)
set(SLAM_HAS_GRPC @SLAM_HAS_GRPC@)

if (SLAM_FIND_QUIETLY)
   set(QUIET_OR_REQUIRED_OPTION "QUIET")
elseif (SLAM_FIND_REQUIRED)
   set(QUIET_OR_REQUIRED_OPTION "REQUIRED")
else ()
   set(QUIET_OR_REQUIRED_OPTION "")
endif()

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${SLAM_CMAKE_DIR}/modules)

find_package(Ceres ${QUIET_OR_REQUIRED_OPTION} HINTS ${CERES_DIR_HINTS})
if (WIN32)
    find_package(glog REQUIRED)
endif()
find_package(absl ${QUIET_OR_REQUIRED_OPTION})
if(SLAM_HAS_GRPC)
   find_package(async_grpc ${QUIET_OR_REQUIRED_OPTION})
endif()

include("${SLAM_CMAKE_DIR}/SlamTargets.cmake")

unset(QUIET_OR_REQUIRED_OPTION)
